package com.thering.movie_servers.movies.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.thering.movie_servers.movies.pojo.Movie;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * author: the_ring
 * date: 2022/5/11
 * function: Mapper
 */
@Mapper
@Repository
public interface MovieMapper extends BaseMapper<Movie> {

    @Select("select m.* from movies m join sortByType s where m.id = s.movie_id and s.type=#{type} order by m.rating desc")
    List<Movie> Join(String type);
}
